import 'package:flutter/material.dart';

class Widget_LimitedBox_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: Text("LimitedBox"),
          ),
          body: Row(
            children: <Widget>[
              LimitedBox(
                maxHeight: 100.0,
                maxWidth: 100.0,
                child: Container(
                  width: 400.0,
                  height: 400.0,
                  color: Colors.blue,
                ),
              ),
              Container(
                width: 100.0,
                height: 100.0,
                color: Colors.blue,
                margin: EdgeInsets.only(left: 10.0),
              ),
            ],
          )
      ),
    );
  }
}

/**
 * 限制子元素的最大宽高
 * const LimitedBox({
    Key key,
    this.maxWidth = double.infinity,
    this.maxHeight = double.infinity,
    Widget child,
    })
 */
